package mongo.controller;

import mongo.common.dto.ResponseBody;
import mongo.common.dto.ResponseCode;
import mongo.entiy.po.UserInfo;
import mongo.mapper.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description:
 * @author: liucancan
 * @create: 2019-04-04 10:27
 **/
@RestController
@RequestMapping("/select/user")
public class SelectController {

    @Autowired
    private UserRepository userRepository;

    @GetMapping("getUserList")
    public ResponseBody getUserList() {
        List<UserInfo> userInfoList = userRepository.findAll();
        return ResponseBody.success(ResponseCode.OK.MSG, userInfoList);
    }
}
